package com.workflow.workflowproject.pojo.lowflow.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

import java.io.Serial;

/**
 *  表定义层。
 *
 * @author Administrator
 * @since 2024-10-31
 */
public class FlowNodeApproveTableDef extends TableDef {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public static final FlowNodeApproveTableDef FLOW_NODE_APPROVE = new FlowNodeApproveTableDef();

    /**
     * 流程节点id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 发起人自己：0-单选，1-多选
     */
    public final QueryColumn SELF = new QueryColumn(this, "self");

    /**
     * 多人审批方式
     */
    public final QueryColumn MULTI = new QueryColumn(this, "multi");

    /**
     * 审批人角色
     */
    public final QueryColumn ROLES = new QueryColumn(this, "roles");

    /**
     * 审批人
     */
    public final QueryColumn USERS = new QueryColumn(this, "users");

    /**
     * 发起人自选：0-单选，1-多选
     */
    public final QueryColumn CHOICE = new QueryColumn(this, "choice");

    /**
     * 部门
     */
    public final QueryColumn LEADER = new QueryColumn(this, "leader");

    /**
     * 审批人为空时处理方式
     */
    public final QueryColumn NOBODY = new QueryColumn(this, "nobody");

    /**
     * 表单内角色
     */
    public final QueryColumn FORM_ROLE = new QueryColumn(this, "formRole");

    /**
     * 表单内人员
     */
    public final QueryColumn FORM_USER = new QueryColumn(this, "formUser");

    /**
     * 项目
     */
    public final QueryColumn ORG_LEADER = new QueryColumn(this, "orgLeader");

    /**
     * 流程文件id
     */
    public final QueryColumn FLOW_FILE_ID = new QueryColumn(this, "flow_file_id");

    /**
     * 审批人为空时指定人员
     */
    public final QueryColumn NOBODY_USERS = new QueryColumn(this, "nobodyUsers");

    /**
     * 审批对象（）
     */
    public final QueryColumn ASSIGNEE_TYPE = new QueryColumn(this, "assignee_type");

    /**
     * 多人会签通过百分比
     */
    public final QueryColumn MULTI_PERCENT = new QueryColumn(this, "multiPercent");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, FLOW_FILE_ID, ASSIGNEE_TYPE, FORM_USER, FORM_ROLE, USERS, ROLES, LEADER, ORG_LEADER, CHOICE, SELF, MULTI, MULTI_PERCENT, NOBODY, NOBODY_USERS};

    public FlowNodeApproveTableDef() {
        super("", "t_com_flow_node_approve");
    }

    private FlowNodeApproveTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public FlowNodeApproveTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new FlowNodeApproveTableDef("", "t_com_flow_node_approve", alias));
    }

}
